<?php
include_once("../globals.php");
?>

<html style="background-color: rgb(255, 255, 255);">
<head>

<link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">

<link type="text/css" href="/interface/themes/style_metal.css" rel="stylesheet">

<style type="text/css">
      .hidden {
        display:none;
      }
      .visible{
        display:block;
      }
</style>

<script type="text/javascript" language="javascript">

function toencounter(rawdata) {
//This is called in the on change event of the Encounter list.
//It opens the corresponding pages.
	document.getElementById('EncounterHistory').selectedIndex=0;
	if(rawdata=='')
	 {
		 return false;
	 }
	else if(rawdata=='New Encounter')
	 {
	 	top.window.parent.left_nav.loadFrame2('nen1','RBot','forms/newpatient/new.php?autoloaded=1&calenc=')
		return true;
	 }
	else if(rawdata=='Past Encounter List')
	 {
	 	top.window.parent.left_nav.loadFrame2('pel1','RBot','patient_file/history/encounters.php')
		return true;
	 }
    var parts = rawdata.split("~");
    var enc = parts[0];
    var datestr = parts[1];
    var f = top.window.parent.left_nav.document.forms[0];
	frame = 'RBot';
    if (!f.cb_bot.checked) frame = 'RTop'; else if (!f.cb_top.checked) frame = 'RBot';

    top.restoreSession();
<?php if ($GLOBALS['concurrent_layout']) { ?>
    parent.left_nav.setEncounter(datestr, enc, frame);
    parent.left_nav.setRadio(frame, 'enc');
    top.frames[frame].location.href  = '../patient_file/encounter/encounter_top.php?set_encounter=' + enc;
<?php } else { ?>
    top.Title.location.href = '../patient_file/encounter/encounter_title.php?set_encounter='   + enc;
    top.Main.location.href  = '../patient_file/encounter/patient_encounter.php?set_encounter=' + enc;
<?php } ?>
}
function showhideMenu(inicio) {
	var m = parent.document.getElementById("fsbody");
	var targetWidth = '0,*';
	if (m.cols == targetWidth) {
		m.cols = '<?php echo $GLOBALS['gbl_nav_area_width'] ?>,*';
		if(inicio!=1){
			document.getElementById("showMenuLink").innerHTML = '<?php echo htmlspecialchars( xl('Hide Menu'), ENT_QUOTES); ?>';
		}
	} else {
		m.cols = targetWidth;
		document.getElementById("showMenuLink").innerHTML = '<?php echo htmlspecialchars( xl('Show Menu'), ENT_QUOTES); ?>';
	}
}
showhideMenu(1);
</script>
</head>
<body>

<?php
$res = sqlQuery("select * from users where username='".$_SESSION{"authUser"}."'");
?>


    
</div>
<div style="width: 960px; margin: auto;">
<div class="header" style="background: none repeat scroll 0 0 rgb(255, 255, 255);
    color: rgb(51, 51, 51);
    margin: 40px 0 20px;
    position: relative;
    z-index: 2">
<a href="/" title="HealthVault">
        <img alt="HealthVault" src="../../images/sac.jpg" style="float: left; margin-top: -27px;">
    </a>
	<table cellspacing="0" cellpadding="0" width="53%" height="67%">
<tr>
<td style="margin:3px 0px 3px 0px;vertical-align:middle;">
        <div style='margin-left:10px; float:left; display:none' id="current_patient_block">
            <span class='text'><?php xl('Patient','e'); ?>:&nbsp;</span><span class='title_bar_top' id="current_patient"><b><?php xl('None','e'); ?></b></span>
        </div>
</td>
<td style="margin:3px 0px 3px 0px;vertical-align:middle;" align="left">
	<table cellspacing="0" cellpadding="1" ><tr><td>
		<div style='margin-left:5px; float:left; display:none' id="past_encounter_block">
			<span class='title_bar_top' id="past_encounter"><b><?php echo htmlspecialchars( xl('None'), ENT_QUOTES) ?></b></span>
		</div></td></tr>
	<tr><td valign="baseline" align="center">	
        <div style='display:none' class='text' id="current_encounter_block" >
            <span class='text'><?php xl('Selected Encounter','e'); ?>:&nbsp;</span><span class='title_bar_top' id="current_encounter"><b><?php xl('None','e'); ?></b></span>
        </div></td></tr></table>
</td>
</tr>
</table>
    <div class="links" style="font-size: 13px;
    position: absolute;
    right: 0;
    text-transform: uppercase;
    top: 0;
    white-space: nowrap;">
             <a href='' id='new0' onClick=" return top.window.parent.left_nav.loadFrame2('new0','RTop','new/new.php')">
		<span><?php echo htmlspecialchars( xl('NEW PATIENT'), ENT_QUOTES) ?></span></a>
            <span class="grayText spacer wide">|</span>
           <a style='vertical-align:text-bottom;' href="main_title.php" id='showMenuLink' onclick='javascript:showhideMenu();return false;'><?php xl('Show Menu','e'); ?></a>
            <span class="grayText spacer wide">|</span>
            <a href="../logout.php?auth=logout" target="_top" id="logout_link" onclick="top.restoreSession()" >
			<?php echo htmlspecialchars( xl('Logout'), ENT_QUOTES) ?></a>
    </div>


<script type="text/javascript" language="javascript">
parent.loadedFrameCount += 1;
</script>
</div>
</body>
</html>
